// 构造函数
function Person(name,age){
    // 添加属性
    this.name = name;
    this.age = age;
}

Person.prototype.eat = function(){
    console.log("吃饭");
}

// student
function Student(name,age,sex){
    // 继承属性
    Person.call(this,name,age);
    this.sex = sex;
}

// 继承方法
Student.prototype = new Person();
Student.prototype.constructor = Student;

Student.prototype.play = function(){
    console.log("打篮球");
}


let s1 = new Student("小杨",18,"男");

// console.log(s1);

// s1.play();

s1.eat();


